home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Trusted Irix /B 4.0.4
/
Trusted-Irix B-4.0.1.iso
/
dist
/
eoe1.idb
/
usr
/
include
/
sys
/
tsreg.h.z
/
tsreg.h
Wrap
C/C++ Source or Header
|
1992-04-03
|
5KB
|
151 lines
/*
* Device registers for the ISI VME-QIC2/X cartridge tape controller.
*
* $Revision: 3.5 $
*/
/*
* Controller registers
*/
struct tsdevice {
ushort tcpr; /* write: low word of data buffer address */
ushort txcpr; /* write: high word of data buf addr */
ushort clkreg; /* read/write: clock register (not used) */
ushort atxcpr; /* write: alternate dba */
};
#define tssr txcpr /* read: status register */
#define TXCPR_RESET 0x8000 /* subsystem clear */
#define TXCPR_RETENSION 0xC000 /* tape retention */
/* bits in tssr status register */
#define TSSR_SC 0x8000 /* special condition (error) */
#define TSSR_RMR 0x1000 /* register modification refused */
#define TSSR_NXM 0x0800 /* nonexistant memory */
#define TSSR_NBA 0x0400 /* need buffer address */
#define TSSR_SSR 0x0080 /* subsytem ready */
#define TSSR_OFL 0x0040 /* off-line */
#define TSSR_TC 0x000E /* termination codes */
/* termination codes */
#define TSTC_OK 0x0000 /* TC0: normal termination */
#define TSTC_ATTN 0x0002 /* TC1: attention */
#define TSTC_ALERT 0x0004 /* TC2: tape status alert */
#define TSTC_REJECT 0x0006 /* TC3: function reject */
#define TSTC_UNREC0 0x0008 /* TC4: unrecoverable, tape position lost */
#define TSTC_UNREC1 0x000A /* TC5: unrecoverable, tape position lost */
#define TSTC_UNREC2 0x000C /* TC6: unrecoverable, tape position lost */
#define TSTC_FATAL 0x000E /* TC7: fatal error */
/* status message */
struct tsstatus {
ushort header; /* packet header */
ushort len; /* packet length */
ushort rbpcr; /* residual frame count */
ushort xs0; /* see bits defined below */
ushort xs1; /* see bits defined below */
ushort xs2; /* always zero */
ushort xs3; /* see bits defined below */
ushort pad; /* not used */
};
/* bits header */
#define TSX_ACK 0x8000 /* acknowledge */
/* Error codes in xstat 0 */
#define XS0_TMK 0x8000 /* tape mark detected */
#define XS0_RLS 0x4000 /* record length short */
#define XS0_LET 0x2000 /* logical end of tape */
#define XS0_RLL 0x1000 /* record length long */
#define XS0_WLE 0x0800 /* write lock error */
#define XS0_NEF 0x0400 /* non-executable function */
#define XS0_ILC 0x0200 /* illegal command */
#define XS0_ILA 0x0100 /* illegal address */
#define XS0_ONL 0x0040 /* on-line */
#define XS0_IE 0x0020 /* interrupt enable status */
#define XS0_WLK 0x0004 /* write locked */
#define XS0_BOT 0x0002 /* beginning of tape */
#define XS0_EOT 0x0001 /* end of tape */
/* Error codes in xstat 1 */
#define XS1_UNC 0x0002 /* uncorrectable data */
/* Error codes in xstat 3 */
#define XS3_REV 0x0020 /* tape motion is reverse */
#define XS3_RIB 0x0001 /* reverse into BOT */
/* command message */
struct tscmd {
ushort cmd; /* command */
ushort balo; /* low order buffer address */
ushort bahi; /* high order buffer address */
ushort bytecount;
};
/* commands and command bits */
#define TSCMD_ACK 0x8000 /* ack - release command packet */
#define TSCMD_MUSTBEONE 0x4000 /* must be one */
#define TSCMD_SWB_ 0x1000 /* don't swap bytes (active low) */
#define TSCMD_IE 0x0080 /* interrupt enable */
#define TSCMD_READ 0x0001 /* read data */
#define TSCMD_WRITECHAR 0x0004 /* write characteristics */
#define TSCMD_WRITE 0x0005 /* write data */
#define TSCMD_FSR 0x0008 /* forward space record */
#define TSCMD_FSF 0x0208 /* forward space file */
#define TSCMD_REWIND 0x0408 /* rewind */
#define TSCMD_WFMK 0x0009 /* write file mark */
#define TSCMD_RESET 0x000B /* initialize controller */
#define TSCMD_SENSE 0x000F /* get status */
#define TSCMD_CMD 0x0F1F /* bits that commands use */
#define TSCMD_RETENSION 0x7FFF /* retension pseudo-command */
/* characteristics data */
struct tschar {
ushort balo; /* low address of status packet */
ushort bahi; /* high address of status packet */
ushort bytecount; /* its size */
ushort mode; /* characteristics */
};
/* bits in characteristics mode */
#define TSCHAR_ESS 0x0080 /* enable skip tape marks stop */
#define TSCHAR_ENB 0x0040 /* enable tape mark stop off BOT */
#define TSCHAR_RAW 0x0008 /* enable non-block mode */
#define TSCHAR_Q11 0x0004 /* use qic-11 mode */
#define TSCHAR_FMT 0x0002 /* enable format */
/*
* Software state per tape drive.
*/
#define TSBUFSIZE 4096
struct tssoftc {
short sc_flags; /* state flags */
char sc_ctlr; /* controller # */
int sc_id; /* timeout id */
long sc_ticks; /* # of timeout ticks left */
volatile struct tsdevice *sc_device;
struct tscmd sc_cmd; /* the command packet */
struct tschar sc_char; /* characteristics packet */
struct tsstatus sc_status; /* status block */
};
/* software state of the drive */
#define TSC_PROBED 0x0001 /* controller probed */
#define TSC_INITIALIZED 0x0002 /* has been initialized */
#define TSC_OPEN 0x0004 /* device is open and in use */
#define TSC_BUSY 0x0008 /* busy */
#define TSC_WAITING 0x0010 /* somebody want's a wakeup */
#define TSC_WRITTEN 0x0020 /* tape has been written */
#define TSC_READ 0x0040 /* tape has been read */
#define TSC_BUSTED 0x0080 /* things are busted/hard error */
#define TSC_REWINDING 0x0100 /* tape is rewinding */
#define TSC_RETENSIONING 0x0200 /* tape is retensioning */
#define TSC_ERROR 0x0400 /* error on last command */
#define TSC_FILEMARK 0x0800 /* file mark seen */
#ifdef _KERNEL
extern struct tssoftc tssoftc[];
extern int tsctlrs;
extern char tsbuf[][TSBUFSIZE];
#endif